<template>
    <div class="popup-wrap">
        <div class="popup-text">{{page}} Page</div>
    </div>
</template>

<script setup>
    import {onBeforeMount} from 'vue'
    import {sendMsg, addListenerMsg} from "/src/utils"
    import chat from "/src/components/chat.vue"

    let page = "popup"

    onBeforeMount(() => {
        // const port = chrome.runtime.connect({name: "popup"});
        // port.postMessage({
        //     cmd:'from_popup'
        // })
        // port.onMessege.addListener((msg)=>{
        //     console.log(msg);
        // })
        sendMsg({
            page: page,
            cmd: "in"
        })

        addListenerMsg((request, sender, sendResponse) => {
            console.log('popup request', request)
        })
    })
</script>

<style lang="less">
    .popup-wrap {
        width: 300px;
        height: 400px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        .popup-text {
            font-size: 16px;
        }
    }
</style>